﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WcfContrib.Utils
{
    static class TypeHelper
    {
        public static object CreateDefaultOfType(Type type)
        {
            Type elementType = type.GetElementType();
            if (elementType != null)
            {
                type = elementType;
            }

            return (!type.IsValueType || type == typeof(void))
                ? null
                : Activator.CreateInstance(type);
        }
    }
}
